<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<script type="text/javascript">
var oEditors = [];

//추가 글꼴 목록
//var aAdditionalFontSet = [["MS UI Gothic", "MS UI Gothic"], ["Comic Sans MS", "Comic Sans MS"],["TEST","TEST"]];

nhn.husky.EZCreator.createInIFrame({
	oAppRef: oEditors,
	elPlaceHolder: "boarditemsView",
	sSkinURI: "smarteditor/SmartEditor2Skin.html",	
	htParams : {
		bUseToolbar : true,				// 툴바 사용 여부 (true:사용/ false:사용하지 않음)
		bUseVerticalResizer : true,		// 입력창 크기 조절바 사용 여부 (true:사용/ false:사용하지 않음)
		bUseModeChanger : true,			// 모드 탭(Editor | HTML | TEXT) 사용 여부 (true:사용/ false:사용하지 않음)
		//aAdditionalFontList : aAdditionalFontSet,		// 추가 글꼴 목록
		fOnBeforeUnload : function(){
			//alert("완료!");
		}
	}, //boolean
	fOnAppLoad : function(){
		//예제 코드
		//oEditors.getById["boarditemsView"].exec("PASTE_HTML", ["로딩이 완료된 후에 본문에 삽입되는 text입니다."]);
	},
	fCreator: "createSEditor2"
});

function showHTML() {
	var sHTML = 
	test = sHTML;
	alert(sHTML);
}
var test;

function aboardItemsAdd(boardNo){
	var test = oEditors.getById["boarditemsView"].getIR();
	$.ajax({
		url: 'board.spring?action=boardItemsAdd&boardNo=' + boardNo ,
		method:'post',	
		data: {
			memberId : document.getElementsByName("memberId")[0].value,
			boarditemsTitle : document.getElementsByName("boarditemsTitle")[0].value,
			boarditemsView : test 
		},
		success:function(html){
			$(".parsingPage").html(html);
		}
		
	});
}

</script>

<div id="boardItemsWrite" style="height: 1030px; width: 800px; margin: 56px 0px 0px 95px;">
	<form id="addForm" name="addForm" method="post">
		<input type="hidden" name="boardNo" value="${board.boardNo}" />
		<input type="hidden" name="memberId" value="${login.memberId }"/>
		<table width="100%" border="0" cellspacing="0" cellpadding="0" class="itemHeader">
			<tr>
				<td width="10%">작성자 : </td>
				<td width="*" align="left">${login.memberNickname } &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| 
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				<font color="red">${board.boardName }</font></td>
			</tr>
			<tr>
				<td width="10%">제목 : </td>
				<td width="*" align="left">
					<input type="text" name="boarditemsTitle" style="width: 85%;" /> 
					<input type="checkbox" name="boardItemsNoticeYn"> 공지글</td>
			</tr>
			<tr>
				<td width="10%">파일첨부 : </td>
				<td width="*" align="left"><a href="javascript:">파일업로드</a></td>
			</tr>
			<tr>
				<td colspan="2">
					 <textarea id="boarditemsView" name="boarditemsView" rows="10" style="width:766px; height:412px; display:none;"></textarea>x	
				</td>
			</tr>
<!-- 			<tr>
			<td></td>
				<td>
					<div id="divDialogFile" title="첨부파일 업로드">
						<iframe id="frame" src="" width="400" height="200"
							style="border: 0;"> </iframe>
					</div>
				</td>
			</tr> -->
			<tr>
				<td align="center" colspan="2" width="*">
					<input type="button" value="저장" onclick="aboardItemsAdd(${board.boardNo });">&nbsp;&nbsp;
					<button type="reset">취소</button>
				</td>
			</tr>
		</table>
	</form>



</div>

